import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Index',
    component: () => import('@/pages/Home.vue'),
  },
  {
    path: '/list',
    name: 'List',
    component: () => import('@/pages/List.vue'),
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import('@/pages/Detail.vue'),
  },
  {
    path: '/city',
    name: 'City',
    component: () => import('@/pages/City.vue'),
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('@/pages/Search.vue'),
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'not-found',
    component: () => import('@/pages/NotFound.vue'),
  },
];

const router = createRouter({
  // history: import.meta.env.BASE_URL,
  history: createWebHashHistory(),
  routes,
});

export default router;
